//
//  SearchTopicButtonTableViewCell.m
//  miaopai
//
//  Created by duyifang on 15/11/20.
//  Copyright © 2015年 Crow Zhang. All rights reserved.
//

#import "SearchTopicButtonTableViewCell.h"

@interface SearchTopicButtonTableViewCell ()

@property(nonatomic, retain) UIButton *moreTopicButton;

@end

@implementation SearchTopicButtonTableViewCell

- (void)dealloc
{
    [_moreTopicButton release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.moreTopicButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_moreTopicButton addTarget:self action:@selector(pushToMoreTopics) forControlEvents:UIControlEventTouchUpInside];
        [self.contentView addSubview:_moreTopicButton];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _moreTopicButton.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
    [_moreTopicButton setTitle:@"更多相关话题" forState:UIControlStateNormal];
    _moreTopicButton.titleLabel.font = [UIFont systemFontOfSize:15];
    [_moreTopicButton setTitleColor:[UIColor colorWithRed:0.5974 green:0.5974 blue:0.5974 alpha:1.0] forState:UIControlStateNormal];
}

- (void)pushToMoreTopics
{
    [self.delegate pushToMoreTopicsViewController];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
